package EP::EPC::Core::Upload::ParserFactory;

use strict;

use Carp;
use Carp qw (cluck);
use CGI;

#Returns a Parser of class 'type'
sub new
{
   my $class = shift;
   my $type = shift;    
   my $parser = "EP::EPC::Core::Upload::Parser";  
   $parser .= "::$type";
   
   #dynamically load appropriate parser class and return an instance thereof
   eval "require $parser" or die "problem with parser for this type of data. Are you sure it's installed?";
   return new $parser;   
   
}

1;
